<?php
	include "class.smtp.php";
	include "class.phpmailer.php";
	
	$Host = "smtp.gmail.com";						// SMTP servers
	$Username = "ionutadrianflorea@gmail.com";		// SMTP password
	$Password = "adrian#23";						// SMTP username
	
	$From = "ionutadrianflorea@gmail.com";
	$FromName = "From Name";
	
	$To = "ionutadrianflorea@gmail.com";
	$ToName = "To Name";
	
	$Subject = "Hello there, you will receive some files";
	$Body = "This is a test email which includes attachment";

	$mail = new PHPMailer();
	$mail->SMTPSecure = "ssl";  
    $mail->IsSMTP();                 				// send via SMTP
    $mail->Host = $Host;
    $mail->Port = "465"; 
    $mail->Username = $Username;  
    $mail->Password = $Password;
    $mail->SMTPKeepAlive = true;  
	$mail->Mailer = "smtp"; 
	$mail->IsSMTP();					 			// telling the class to use SMTP  
	$mail->SMTPAuth   = true;            			// enable SMTP authentication  
	$mail->CharSet = 'utf-8';  
	$mail->SMTPDebug  = 0; 
    
    $mail->From     = $From;
    $mail->FromName = $FromName;
	
	$mail->AddAddress($To , $ToName);

    $mail->WordWrap = 50;							// set word wrap
	$mail->Priority = 1; 
    $mail->IsHTML(true);  
    $mail->Subject  =  $Subject;
    $mail->Body     =  $Body;
	
	$mail->AddAttachment("ghidapicol.pdf");      	// attachment
	
    if(!$mail->Send())
    {
        echo "Mailer Error: " . $mail->ErrorInfo;
    }
    else
    {
        echo 'Message has been sent.';
    }
?>